using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

[XLua.LuaCallCSharp]
public static class TransformHelper
{
    public static void EveryChild(this Transform tf, Action<Transform> action)
    {
        action(tf);
        for (int i = 0; i < tf.childCount; i++)
        {
            EveryChild(tf.GetChild(i), action);
        }
    }

    public static void MoveTo(this Transform tf, Transform target, float speed, Action onComplate)
    {
        tf.gameObject.AddComponent<MoveTo>().SetParams(target, speed, onComplate);
    }
}